<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //Map集合API,key可以是任何类型
        let m = new Map()
        m.set('name', 'sgg')
        m.set('change', function(){
            console.log('我们可以改变你')
        })
        let keyObj = {
            school: 'ATGG'
        }
        m.set(keyObj, ['北京', '上海', '深圳'])

        //map支持遍历，每个元素是一个2元数组
        for(let v of m) {
            console.log(v)
        }

        console.log(m.size)
        console.log(m)
        m.delete('name')
        console.log(m)

        console.log(m.get('change'))
        console.log(m.get(keyObj))

        //清空
        m.clear()
    </script>
</body>
</html>